<?php
/*
---------------------------------------------------------------------
- 功能描述: 团队管理
- 文件名:managerController.php
- 版本: 1.0
- 原作者:wangpeng
- 编写日期:2013/2/4
- 运行环境:---
- 修改记录:
---------------------------------------------------------------------
*/

class managerController extends Base
{

	/**
	* 构造函数
	*
	* @access public
	* @param
	* @return void
	*/
	public function __construct()
	{
		//是否登录
		if(!Admin::isAdminLogin())
		{
			Common::header("/login.html");
		}

		//自定义分页
		Admin::loadCustom();
	}

	/**
	* 留言审核
	*
	* @access public
	* @param  void
	* @return void
	*/
	public function logsAction()
	{
		$this->page->PerPage = $_SESSION['libvar']['pageset'];
		$this->page->Page = parent::$args['page'];

		$aRes = $this->admin_managerModule->listLogs($this->page);

		$this->smarty->assign("list", $aRes);
		$this->smarty->assign("pagecount", $this->page->Count);
		$this->smarty->assign("page", $this->page->getPage());
		$this->smarty->display("admin/logs/logs_list.html");
	}

	/**
	* 留言修改、通过、删除
	*
	* @access public
	* @param  void
	* @return void
	*/
	public function optAction()
	{
		//删除信息
		if(parent::$args['act'] == 'del')
		{
			$this->com_topModule->delTop(parent::$args['id']);
		}

		//修改信息
		else if(parent::$args['act'] == 'edit')
		{
			if($_POST['act'] == '确定')
			{
				$this->com_topModule->setTop($_POST['id'], $_POST['days'], $_POST['pay']);
				Common::forward($_POST['forward']);
			}
			else
			{
				$aInfo = $this->com_topModule->getTop(parent::$args['id']);

				$this->smarty->assign("info", $aInfo);
				$this->smarty->assign("forward", $_SERVER['HTTP_REFERER']);
				$this->smarty->display("admin/com/top_edit.html");
				exit;
			}
		}

		Common::forward($_SERVER['HTTP_REFERER'], "parent");
	}
}
?>